<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="ExpedienteCreateDlg" widgetVar="ExpedienteCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{myBundle.CreateExpedienteTitle}" closeOnEscape="true" >

            <h:form id="ExpedienteCreateForm">

                <h:panelGroup id="display" rendered="#{expedienteBean.expedienteSelected != null }">
                    <p:panelGrid columns="2" columnClasses="column">

                        <p:outputLabel value="#{myBundle.CreateExpedienteLabel_partido}" for="partido" />
                        <p:selectOneMenu id="partido" value="#{expedienteBean.expedienteSelected.partido}" converter="partidoConverter" >
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{partidoController.items}"
                                           var="partido"
                                           itemValue="#{partido}"
                                           itemLabel="#{partido.nombre}"
                                           />
                        </p:selectOneMenu>

                        <p:outputLabel value="#{myBundle.CreateExpedienteLabel_alcance}" for="alcance" />
                        <p:inputText id="alcance" value="#{expedienteBean.expedienteSelected.alcance}" title="#{myBundle.CreateExpedienteTitle_alcance}" required="true" requiredMessage="#{myBundle.CreateExpedienteRequiredMessage_alcance}" size="40" maxlength="40"/>

                        <p:outputLabel value="#{myBundle.CreateExpedienteLabel_cuerpo}" for="cuerpo" />
                        <p:inputText id="cuerpo" value="#{expedienteBean.expedienteSelected.cuerpo}" title="#{myBundle.CreateExpedienteTitle_cuerpo}" size="40" maxlength="40"/>

                        <p:outputLabel value="#{myBundle.CreateExpedienteLabel_extracto}" for="extracto" />
                        <p:inputText id="extracto" value="#{expedienteBean.expedienteSelected.extracto}" title="#{myBundle.CreateExpedienteTitle_extracto}" size="40" maxlength="40"/>

                        <p:outputLabel value="#{myBundle.CreateExpedienteLabel_fechaInicio}" for="fechaInicio" />
                        <p:calendar id="fechaInicio" pattern="MM/dd/yyyy" value="#{expedienteBean.expedienteSelected.fechaInicio}" title="#{myBundle.CreateExpedienteTitle_fechaInicio}"  showOn="button"/>

                        <p:outputLabel value="#{myBundle.CreateExpedienteLabel_numero}" for="numero" />
                        <p:inputText id="numero" value="#{expedienteBean.expedienteSelected.numero}" title="#{myBundle.CreateExpedienteTitle_numero}" size="20" maxlength="20"/>

                        <p:outputLabel value="#{myBundle.CreateExpedienteLabel_tipoExpedienteId}" for="tipoExpedienteId" />
                        <p:selectOneMenu id="tipoExpedienteId" value="#{expedienteBean.expedienteSelected.tipoExpedienteId}"  converter="tipoExpedienteConverter">
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{tipoExpedienteController.items}"
                                           var="tipoExpedienteIdItem"
                                           itemValue="#{tipoExpedienteIdItem}"
                                           itemLabel="#{tipoExpedienteIdItem.nombre}"
                                           />

                        </p:selectOneMenu>

                         <p:outputLabel value="#{myBundle.CreateExpedienteLabel_barrioId}" for="barrioId" />
                        <p:selectOneMenu id="barrioId" value="#{expedienteBean.expedienteSelected.barrioId}"  converter="barrioConverter">
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{barrioController.items}"
                                           var="barrioIdItem"
                                           itemValue="#{barrioIdItem}"
                                           itemLabel="#{barrioIdItem.nombre}"
                                           />

                        </p:selectOneMenu>
                    </p:panelGrid>

                    <p:commandButton actionListener="#{expedienteBean.expedienteSaveNew}" value="#{myBundle.Save}" update="display,:ExpedienteListForm:datalist,:growl" oncomplete="PF('ExpedienteCreateDialog').hide();"/>    
                    <p:commandButton value="#{myBundle.Cancel}" onclick="ExpedienteCreateDialog.hide()" immediate="true"/>

                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
